package com.boco.blch.analysiser.compliance.HW.manager;

import com.boco.blch.analysiser.compliance.ComplianceResolved;
import com.boco.blch.analysiser.util.XmlUtil;

public class BOCO_Hive_VisitCtl_UserVisitCtl implements ComplianceResolved{

	private final static String EXPECT_RESULT = "true";
	private static final String TAG_NAME = "hive.security.authorization.enabled";
	private final static String EXPECT_RESULT1 = "ALL";
	private static final String TAG_NAME1 = "hive.security.authorization.createtable.owner.grants";
	@Override
	public int realEchoResolved(String echoResult) {
		if(echoResult != null && echoResult.trim().length() > 0){
			String result = XmlUtil.getValueByName(echoResult, TAG_NAME);
			String result1 = XmlUtil.getValueByName(echoResult, TAG_NAME1);
			if(EXPECT_RESULT.equalsIgnoreCase(result)&&EXPECT_RESULT1.equalsIgnoreCase(result1))
				return SUCCESS;
		}
		return FAILED;
	}
}
